function Test() {
    this.title = "test";
    this.test = function (arg1, arg2) {
        console.log(this.title + " " + arg1 + " " + arg2);
    }
};

const obj = {
    title: "obj"
};

const test = new Test();
test.test(2, 3);
test.test.call(obj, 1, 2);

test.test(4, 5);
test.test.apply(obj, [6, 7]);

const func = test.test.bind(obj, 10);
func(20);


// class TestClass {
//     a = 1;
//     b = 2;
//     test() {
//         return this.a + this.b;
//     }
// }
// const testClass = new TestClass();
// console.log(testClass.test());
// console.log(testClass.test.call(obj));

// console.log(testClass.test.bind(obj)());